package cn.controller;

import org.apache.catalina.servlet4preview.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class HomeController {


    @ResponseBody
    @RequestMapping(value = "/home", method = {RequestMethod.GET})
    public String home(HttpServletRequest request){

        System.out.println("请求进来了");

        return "你好";//直接返回字符串的话，上面加@ResponseBody
                        //返回模板引擎的话，@ResponseBody不要加

    }


}
